<?php
/**
 * 书签相关操作
 * [ranknow bbs!] (C)2009-2015 ranknow.cn.
 *
 * @author liwei
 * @This is NOT a freeware, use is subject to license terms
 * @rcsfile $RCSfile: bookmark.php,v $
 * @revision $Revision: 0.1 $
 * @date $Date: 2010/01/4 15:26:17 $
 */
require 'config.inc.php';
include BBS_MDL_PATH . 'mdl_bookmark.php';
$action = $_GET['action']?$_GET['action']:'';
$tid = $_POST['tid']?$_POST['tid']:'';
if ( $action == 'addbookmark' && $_SESSION['bbs_user_id'] && $tid ) {
    $data_bookmark = array( 'uid' => $_SESSION['bbs_user_id'], 'tid' => $tid );
    dbConnect();
    $ret = 'fail';
    if ( add_bookmark( $data_bookmark ) ) {
        $ret = 'ok';
        set_flash( 'sysinfo', '收藏文章成功!' );
    } else {
        $ret = 'fail';
        set_flash( 'sysinfo', '您以前收藏过这篇文章' );
    }
    echo $ret;
    dbDisconnect();
}
// $template = front_load_template( 'bookmark.html' );
// $template -> display( $template_data );
// windowNoCache();

?>